﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Ext.Net;
using Demo.Web.MVC.Controllers;

namespace Demo.Web.MVC.Readers
{
    /// <summary>
    /// Summary description for ResourceReader
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class ResourceReader : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";            
            context.Response.Write(string.Format("{{'Resource':{0}}}", JSON.Serialize(ResourceController.GetResources())));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}